import { App } from 'vue'
// const node_modules_files = import.meta.glob('/node_modules/@xuekl/cli-components/*.vue', { eager: true })

const files = import.meta.glob('./*.vue', { eager: true })

// Object.assign(files, node_modules_files)


export default {
    install: (app: App) => {
        Object.keys(files).forEach((component) => {
            const file = (files[component] as any).default
            // 使用内置的组件名称 进行全局组件注册
            if (file.name) {
                app.component(file.name, file)
            }
        })
    }
}